package com.dy.nygl.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.nygl.mapper.UserInfoMapper;
import com.dy.nygl.pojo.UserInfo;
import com.dy.nygl.service.UserInfoService;



@Service("userInfoService")
public class UserInfoServiceImpl implements UserInfoService {

	@Resource(name = "userInfoDao")
	private UserInfoMapper userInfoDao;

	@Override
	public UserInfo updateInfo(UserInfo userInfo) {
		
		UserInfo userInfo2 = new UserInfo();
		userInfo2.setId(userInfo.getId());
		userInfo2.setName(userInfo.getName());
		userInfo2.setAccount(userInfo.getAccount());
		userInfo2.setPassword(userInfo.getPassword());
		userInfo2.setTel(userInfo.getTel());
		userInfo2.setEmail(userInfo.getEmail());
		userInfo2.setJob(userInfo.getJob());
		userInfo2.setDepartment(userInfo.getDepartment());
		userInfoDao.updateByPrimaryKeySelective(userInfo2);
		return null;
	}

	@Override
	public UserInfo insertInfo(UserInfo userInfo) {
		UserInfo userInfo2=new UserInfo();
		userInfo2.setAccount(userInfo.getAccount());
		userInfoDao.insert(userInfo2);
		return null;
	}

	@Override
	public UserInfo selectByName(String name) {
		UserInfo userInfo=userInfoDao.selectName(name);
		return userInfo;
	}

}
